/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @private
 *
 * @properties={typeid:24,uuid:"51D517FC-DC5B-4B8F-AD70-75882472ABCA"}
 */
function accion(event) {
	
	if (adm_t900_menus_padre_id == null){
		foundset.loadRecords(scopes.adm_t900_menus.mostrar_menu(foundset.getSelectedRecord()));
	}else{
		if (scopes.adm_t900_menus[s_funcion]){
			scopes.adm_t900_menus[s_funcion]();
		}else{
			forms[globals.$frm_siv_main].elements.tab_principal.removeAllTabs();
			forms[globals.$frm_siv_main].elements.tab_principal.addTab(forms["lst_" + s_funcion]);
		}
	}
}

/**
 * Called before the form component is rendered.
 *
 * @param {JSRenderEvent} event the render event
 *
 * @private
 *
 * @properties={typeid:24,uuid:"76CC61AB-CF5A-4E42-818C-E44AD9108AE7"}
 */
function onRenderTexto(event) {

	/** @type {JSRecord<db:/pigeon_board/adm_t900_menus>} */
	var record = event.getRecord();
	if (record && record.adm_t900_menus_padre_id != null) {
		event.getRenderable().bgcolor = '#BBB';
	} else  {
		event.getRenderable().bgcolor = '#888';
	}
}

/**
 * Called before the form component is rendered.
 *
 * @param {JSRenderEvent} event the render event
 *
 * @private
 *
 * @properties={typeid:24,uuid:"F605AA58-8FDE-42F9-98BF-4DB13BAD07C6"}
 */
function onRenderFlecha(event) {

	/** @type {JSRecord<db:/pigeon_board/adm_t900_menus>} */
	var record = event.getRecord();
	if (record && record.adm_t900_menus_padre_id != null) {
		event.getRenderable().imageURL = null;
		event.getRenderable().bgcolor = '#BBB';
	} else  {
		event.getRenderable().imageURL = "media:///iconos/ic_play_arrow_white_18dp.png";
		event.getRenderable().bgcolor = '#888';
	}
}

/**
 * Called before the form component is rendered.
 *
 * @param {JSRenderEvent} event the render event
 *
 * @private
 *
 * @properties={typeid:24,uuid:"31EC609B-72B5-4B00-9E9C-1D2BBD0651BB"}
 */
function onRenderIcono(event) {

	/** @type {JSRecord<db:/pigeon_board/adm_t900_menus>} */
	var record = event.getRecord();
	if (record && record.adm_t900_menus_padre_id != null) {
		if (record && record.s_icono != null){
			event.getRenderable().imageURL = record.s_icono;
		}
		event.getRenderable().bgcolor = '#BBB';
	} else  {
		if (record && record.s_icono != null){
			event.getRenderable().imageURL = record.s_icono;
		}
		event.getRenderable().bgcolor = '#888';
	}
}
